<?php get_header()?>
	<div id="left">
		<?php if (!dynamic_sidebar( 'left_sidebar' ) ) { ?>
			
		<?php } ?>
	</div>
	<div id="center">
		<?php
		global $post;
		//pr($post);
		$category_ids = wp_get_post_categories($post->ID);
		$category = get_category($category_ids[0]);
		//pr($category);
		?>
		<div id="box_center">
			<div class="top">
				<div class="title"><?php the_title()?></div>
			</div>
			<div class="center">
				<div id="entry">
					<?php print $post->post_content?>
				</div>
								
				<?php $other_posts = get_posts('category='.$category->term_id.'&orderby=post_date&order=DESC&post_type=post&post_status=publish&numberposts=10&exclude='.$post->ID);
				//pr($other_posts);
				if (NULL != $other_posts) : ?>
					<div id="others">
						<h2>THÔNG TIN LIÊN QUAN</h2>
						<ul>
							<?php foreach ($other_posts as $p) : ?>
									<li><a href="<?php print get_permalink($p->ID)?>">
										<?php if (empty($p->post_title)) {
											$post_categories = wp_get_post_categories($p->ID);
											$post_category = isset($post_categories[0]) ? $post_categories[0] : 0;
											if (0 != $post_category) {
												print get_category($post_category)->name;
											}
										} else {
											print $p->post_title;
										} ?>
									</a><span class="date-modified"> (<?php print date('d-m-Y', strtotime($p->post_date))?>)</span></li>
							<?php endforeach; ?>
						</ul>
					</div>
				<?php endif; ?>
			</div>
			<div class="bot"></div>
		</div>
		<?php if (!dynamic_sidebar( 'page_content' ) ) { ?>
			
		<?php } ?>
	</div>
	<div id="right">
		<?php if (!dynamic_sidebar( 'right_sidebar' ) ) { ?>
			
			
		<?php } ?>
	</div>
	<div class="clear"></div>
<?php get_footer()?>
